package com.itheima.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.TestMapper;
import com.itheima.pojo.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

//@Service 要用dubbo的不是spring的
//不加事务就只需要一个@Service
//服务加来事务之后需要配置 创建事务代理方式为cglib 还有设置Service注解的interfaceClass属性
@Service(interfaceClass = TestService.class)
@Transactional


public class TestServiceImpl implements TestService {

    @Autowired
    TestMapper testMapper;

    @Override
    public List<Test> m1() {
        return testMapper.m1();//alt + enter
    }
}
